package com.dz.lm.service.talkcomment;

import com.dz.lm.common.dto.PageDto;
import com.dz.lm.common.dto.TalkCommentDto;
import com.dz.lm.common.exception.ServiceException;
import com.dz.lm.domain.talkcomment.TalkComment;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @version 1.8;
 * @author: LDY;
 * @Description;
 * @Date: Created in 2019/12/28 14:14;
 */
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)

public interface TalkComenntService {
    /**
     * 添加评论
     * @param comment
     * @return
     * @throws Exception
     */
    int add(TalkComment comment) throws ServiceException;

    /**
     * 删除评论
     * @param commentId
     * @return
     * @throws Exception
     */
    int delte(Integer commentId) throws ServiceException;

    /**
     * 更新
     * @param comment
     * @return
     * @throws Exception
     */
    int update(TalkComment comment) throws ServiceException;

    /**
     * 主键查询
     * @param commentId
     * @return
     * @throws Exception
     */
    TalkCommentDto queryOne(Integer commentId) throws ServiceException;

    /**
     * 用户id 来查询相关评论
     * @param param
     * @return
     * @throws Exception
     */
    PageDto<TalkCommentDto> queryList(Map<String, Object> param, int page, int rows) throws ServiceException;
}
